﻿@using Janus.Mes.WebClient;
@using Janus.BaseEntitys;
@using Janus.Mes.VO;
@model LocationVO
@{
    Layout = null;
    ViewBag.ViewTitle = "仓位档案";
    IEnumerable<SelectListItem> Warehouse = new SelectList(ViewData["Warehouse"] as List<WarehouseVO> ?? new List<WarehouseVO>(), "WhCode", "WhName");
}
<div class="pageContent">
    <form method="post" action="BaseData/Location/create?OpID=@ViewData["OperateID"]" class="pageForm required-validate"
          onsubmit="return validateCallback(this, dialogAjaxDone);">
        @Html.ValidationSummary(true)
        <div class="pageFormContent" layouth="56">
            <input id="hidIsCreate" name="hidIsCreate" type="hidden" value="@ViewBag.IsCreate" />
            @Html.HiddenFor(model => model.Id)
            <p>
                <label>
                    仓位代码：
                </label>

                @if (ViewBag.IsCreate == true)
                {
                    @Html.TextBoxFor(c => c.LocCode, new { @class = "required IsExisted", ajaxurl = "BaseData/Location/IsExist" })
                }
                else
                {
                    @Html.TextBoxFor(c => c.LocCode, new { @Readonly = "true" })
                }
                @Html.ValidationMessageFor(sysConfig => sysConfig.LocCode)
            </p>
            <p>
                <label>
                    仓库名称：
                </label>
                @Html.DropDownListFor(c => c.WhCode, Warehouse, new { @class = "required combox WidthAsInputCombox",selectedvalue =Model.WhCode })
                @Html.ValidationMessageFor(c => c.WhCode)
            </p>
            <p>
                <label>
                    仓位名称：
                </label>
                @Html.TextBoxFor(c => c.LocName, new { @class = "required" })
                @Html.ValidationMessageFor(c => c.LocName)
            </p>
            <p>
                <label>
                    负责人：
                </label>
                @Html.TextBoxFor(c => c.Person, new { @class = "required" })
                @Html.ValidationMessageFor(c => c.Person)
            </p>
            <p>
                <label>
                    联系电话：
                </label>
                @Html.TextBoxFor(c => c.Tel, new { @class = "required phone" })
                @Html.ValidationMessageFor(c => c.Tel)
            </p>
            <p>
                <label>
                    仓位地址：
                </label>
                @Html.TextBoxFor(c => c.Address, new { @class = "required" })
                @Html.ValidationMessageFor(c => c.Address)
            </p>
            <p>
                <label>
                    默认仓位：
                </label>
                @Html.CheckBoxFor(c => c.IsDefault, new { @class = "required" })
                @Html.ValidationMessageFor(c => c.IsDefault)
            </p>
            <p>
                <label>
                    启用：
                </label>
                @Html.CheckBoxFor(c => c.IsEnable, new { @onclick = "return false" })
            </p>
            <p style="width:100%;height:50px;">
                <label>
                    备注：
                </label>
                @Html.TextAreaFor(c => c.Remark, new { @class = "",@style="width:65%;height:30px" })
                @Html.ValidationMessageFor(c => c.Remark)
            </p>
            @Html.Partial("Operation", Model)
        </div>
        @Html.Partial("FormButtonBar")
    </form>
</div>